package flexconsole.model {
	import mx.collections.ListCollectionView;
	
	import org.puremvc.as3.interfaces.IProxy;
	
	/**
	 * Proxy for the Category XML.
	 *
	 * @author ivanchoo
	 *
	 */
	public interface ICategoryProxy extends IProxy {
		
		/**
		 * Source XML object.
		 */
		function get source():XML;
		/**
		 * @private
		 */
		function set source(xml:XML):void;
		/**
		 * Related collection, useful for data bindings.
		 */
		function get collection():ListCollectionView;
		/**
		 * Returns the category name from the XML item.
		 */
		function getName(xml:XML):String;
		/**
		 * Returns true if the category is marked as selected.
		 */
		function isSelected(xml:XML):Boolean;
		/**
		 * Returns true if the category is marked as open.
		 */
		function isOpen(xml:XML):Boolean;
		/**
		 * Mark the category selection state.
		 */
		function select(xml:XML, bool:Boolean):void;
		/**
		 * Mark the cateogry opened state.
		 */
		function open(xml:XML, bool:Boolean):void;
		/**
		 * Finds a category XML item by name.
		 */
		function find(name:String):XML;
		/**
		 * Adds a new category item to the XML tree.
		 *
		 * <p>The position of the category XML item is automatically calculated.
		 * The category item inherits the selection and open state from its parent.</p>
		 *
		 */
		function add(name:String):XML;
		/**
		 * Removes a category item from the XML tree.
		 */
		function remove(xml:XML):void;
		/**
		 * Remove all categories.
		 */
		function clear():void;
	
	}
}